textview: set text direction information on text handles
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 10 Jun 2015 18:53:12 +0000 (20:53 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 11 Jun 2015 15:14:23 +0000 (17:14 +0200)
This makes them point to the correct place, given the theme supports
this.

gtk/gtktextview.c

index 2badc835b4986286e00655bd2802c0fcc959ad97..7edb925e645800f4bf7620a03852ac329a2346e7 100644 (file)
@@ -4732,6 +4732,9 @@ gtk_text_view_set_handle_position (GtkTextView           *text_view,
     }
   else
     {
+      GtkTextDirection dir = GTK_TEXT_DIR_LTR;
+      GtkTextAttributes attributes = { 0 };
+
       _gtk_text_handle_set_visible (priv->text_handle, pos, TRUE);
 
       rect.x = CLAMP (x, 0, SCREEN_WIDTH (text_view));
@@ -4739,6 +4742,11 @@ gtk_text_view_set_handle_position (GtkTextView           *text_view,
       _text_window_to_widget_coords (text_view, &rect.x, &rect.y);
 
       _gtk_text_handle_set_position (priv->text_handle, pos, &rect);
+
+      if (gtk_text_iter_get_attributes (iter, &attributes))
+        dir = attributes.direction;
+
+      _gtk_text_handle_set_direction (priv->text_handle, pos, dir);
     }
 }